import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;


public class DataInputStreamANDDataOutputStream {
	public static void main(String[] args) {
		DataOutputStream out = null;
		DataInputStream dis =null;

		try {
			FileInputStream fis = new FileInputStream("E:\\FileCopy.txt");
			dis = new DataInputStream(fis);
			FileOutputStream outFile = new FileOutputStream("E:\\temp.txt");
			out =new DataOutputStream(outFile);
			int temp;
			while((temp = dis.read())!=-1) {
				out.write(temp);
			}
		}catch(IOException ioe) {
			ioe.printStackTrace();
		}finally {
			try {
				if(dis!=null)
					dis.close();
				if(out!=null)
					out.close();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}
	}
}
